<%@page contentType="text/html" pageEncoding="UTF-8" import="consultas.funciones"%>
<jsp:useBean id="reg" class="consultas.funciones" scope="session" />


<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>www.queterifas.com</title>
        <link rel="stylesheet" type="text/css" href="css/estilo.css" media="screen" />
        <script src="jshash-2.2/md5-min.js" type="text/javascript"></script>
        <link href='http://fonts.googleapis.com/css?family=Averia+Sans+Libre' rel='stylesheet' type='text/css'>

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        
         <script type="text/javascript">
            function calcMD53(){
            document.getElementById("passi").value=hex_md5(document.getElementById("passi").value);
            }
        </script>
        
    </head>
    <body>
        <!-- INCLUDE PARA METER EL HEADER -->
      <jsp:include page="includes/header.jsp"/>
      <section id="contenedor">
      
                      <div id="login1">
                          <form id="form_login" method="post" action="control.jsp" onsubmit="calcMD53()">
                <input type="text" class="campo_txt" name="username" value="<%=reg.cookieUsu%>" placeholder="Usuario" required /><br>
                <input type="password" class="campo_txt" name="password" id="passi" value="<%=reg.cookiePass%>" placeholder="Password" required /><br>
                
                <input type="checkbox" id="checker" name="checker" value="on">
                <label>Recordarme</label><br><br>
                <button type="submit" name="logear3" >Acceder</button><br>
                
                <% 
                            if(reg.getOkAcceso()== 2){System.out.println("ENTRO EN 2"); %> 
                                   
                            <p>Contraseña incorrecta!</p> 
                                    <% }
                            if(reg.getOkAcceso()== 3){System.out.println("ENTRO EN 3"); %> 
                                    <p>Nombre de usuario/contraseña incorrecto!</p> 
                        <% } %>
             </form>
             <a href='control.jsp?action=registrarse'><button>Registrarse</button></a>
             <br><br>
             
             <a href="control.jsp?action=obtenercontra">¿Has olvidado tu contraseña?</a>
             </div>
          
          
             <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
          
      </section>
      <!-- INCLUDE PARA METER EL FOOTER -->
      <jsp:include page="includes/footer.jsp"/>  
        
    </body>
</html>
